﻿using System;
using System.Configuration;
using Amazon;

namespace Rezene.Web.Business
{
    public class ConfigurationRepository : IConfigurationRepository
    {
        public string GetAmazonAccessKey()
        {
            return ConfigurationManager.AppSettings["AWSAccessKey"];
        }

        public string GetAmazonContainerBucket()
        {
            return ConfigurationManager.AppSettings["AWSBucketName"];
        }

        public RegionEndpoint GetAmazonEndPoint()
        {
            switch(ConfigurationManager.AppSettings["AWSRegion"])
            {
                case "USWest1":
                    return RegionEndpoint.USWest1;
                case "USWest2":
                    return RegionEndpoint.USWest2;
                default:
                    return null;
            }            
        }

        public string GetAllowedExtensions()
        {
            return ConfigurationManager.AppSettings["AllowedExtensions"];
        }

        public string GetAmazonSecretKey()
        {
            return ConfigurationManager.AppSettings["AWSSecretKey"];
        }

        public string GetAdminUsername()
        {
            return ConfigurationManager.AppSettings["AdminUserName"];
        }

        public string GetAdminPassword()
        {
            return ConfigurationManager.AppSettings["AdminPassword"];
        }
    }
}